/*

Author   : chaos

FileName : try_catch.cpp

Date     : 16/08/17 17:59:19

*/
#include <iostream>
#include <string>
using namespace std;

int main(int argc ,char *argv[])
{
    int x, y;

    cout << "Please input two integer for finding "
        << "mdulus ...(x % y)" <<  endl;
    cin >> x >>  y;

    try{
        if(y == 0)
            throw string ("The y cann't be a zero ! \n");

        cout << "modulus is " << x % y << " ." << endl;
    }catch (string s)
    {
        cerr << s;
    }
    return 0;
}
